<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>prencar: D:/Workspace/Arduino/prencar/StateMachine.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="prencar.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">prencar
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_state_machine_8h.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">D:/Workspace/Arduino/prencar/StateMachine.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_state_machine_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef StateMachine_h</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define StateMachine_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;Arduino.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="_communication_8h.html">Communication.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_configuration_8h.html">Configuration.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_line_follow_8h.html">LineFollow.h</a>&quot;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="_curve_left_8h.html">CurveLeft.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="_move_back_to_line_8h.html">MoveBackToLine.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="_lift_cube_8h.html">LiftCube.h</a>&quot;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;<a class="code" href="_cube_approach_8h.html">CubeApproach.h</a>&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_extended_move_8h.html">ExtendedMove.h</a>&quot;</span>
<a name="l00013"></a>00013 
<a name="l00017"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">00017</a> <span class="keyword">enum</span> <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">TParcoursState</a>{ 
<a name="l00018"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a3dcefcfc73c46cd08fedd1d3c0dbaad1">00018</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a3dcefcfc73c46cd08fedd1d3c0dbaad1">notStarted</a>,
<a name="l00019"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a96474cef925f487adb48d8db38ee3455">00019</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a96474cef925f487adb48d8db38ee3455">followingFirstLine</a>,
<a name="l00020"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a8e86865de2ed193e0b3a38fdfe7bd52a">00020</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a8e86865de2ed193e0b3a38fdfe7bd52a">firstTurn</a>,
<a name="l00021"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8abdec259af1c38a7275c56d3e3a00430b">00021</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8abdec259af1c38a7275c56d3e3a00430b">followingSecondLine</a>,
<a name="l00022"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a2f8eb7f135d44d0a27d117159480d80f">00022</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a2f8eb7f135d44d0a27d117159480d80f">secondTurn</a>,
<a name="l00023"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a4843e80df3f3ff6711be6e75a66a2aee">00023</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8a4843e80df3f3ff6711be6e75a66a2aee">followingThirdLineToCube</a>,
<a name="l00024"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ae0dc916c0e29132e7162d68bfd586d1f">00024</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ae0dc916c0e29132e7162d68bfd586d1f">cubeApproach</a>,
<a name="l00025"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ad60f33d823c837c39f2b77eb289b35a3">00025</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ad60f33d823c837c39f2b77eb289b35a3">liftCube</a>,
<a name="l00026"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8aba2a7667be1c205c46189759aa4f6377">00026</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8aba2a7667be1c205c46189759aa4f6377">moveBackToLine</a>,
<a name="l00027"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ac5ddb79d1c7997a726b2a4a1d94d1382">00027</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8ac5ddb79d1c7997a726b2a4a1d94d1382">followingThirdLineToFinish</a>,
<a name="l00028"></a><a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8aaf38e35232eb6728664f98c8110d11a4">00028</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8aaf38e35232eb6728664f98c8110d11a4">finished</a>
<a name="l00029"></a>00029 };
<a name="l00030"></a>00030 
<a name="l00031"></a><a class="code" href="class_state_machine.html">00031</a> <span class="keyword">class </span><a class="code" href="class_state_machine.html">StateMachine</a>
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <span class="keyword">private</span>:
<a name="l00034"></a>00034   <a class="code" href="class_state_machine.html#a2fb07002510ea9141019559750acfab8">StateMachine</a>();
<a name="l00035"></a><a class="code" href="class_state_machine.html#a3e925b470557acefe9e63fb9b883fd77">00035</a>   <span class="keyword">static</span> <a class="code" href="class_state_machine.html">StateMachine</a> <a class="code" href="class_state_machine.html#a3e925b470557acefe9e63fb9b883fd77" title="Static reference to the singleton object.">_instance</a>;
<a name="l00036"></a><a class="code" href="class_state_machine.html#aa39880690c1770cd492706fe70f9036c">00036</a>   <span class="keyword">static</span> <span class="keywordtype">boolean</span> <a class="code" href="class_state_machine.html#aa39880690c1770cd492706fe70f9036c">_instanceCreated</a>;
<a name="l00037"></a>00037   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a18b495baeae11732b76d252b2b8341c8">begin</a>();
<a name="l00038"></a>00038 
<a name="l00039"></a><a class="code" href="class_state_machine.html#ac50a9d394f6fb8dcb5fae975feed7ff2">00039</a>   <a class="code" href="class_communication.html">Communication</a>* <a class="code" href="class_state_machine.html#ac50a9d394f6fb8dcb5fae975feed7ff2" title="The reference to the serial communication class.">_com</a>; 
<a name="l00040"></a><a class="code" href="class_state_machine.html#a432c69d21536a1b991d8493c4aa03d9c">00040</a>   <a class="code" href="class_configuration.html">Configuration</a>* <a class="code" href="class_state_machine.html#a432c69d21536a1b991d8493c4aa03d9c" title="The reference to the configuration class.">_conf</a>; 
<a name="l00041"></a><a class="code" href="class_state_machine.html#a9205e3d16700885cc78e8c9919f44d49">00041</a>   <a class="code" href="class_move.html">Move</a>* <a class="code" href="class_state_machine.html#a9205e3d16700885cc78e8c9919f44d49" title="The reference to the move class.">_move</a>; 
<a name="l00042"></a><a class="code" href="class_state_machine.html#a765e2a69f3af4c9d5f02860cba27de6a">00042</a>   <a class="code" href="class_lift_cube.html">LiftCube</a>* <a class="code" href="class_state_machine.html#a765e2a69f3af4c9d5f02860cba27de6a" title="The reference to the LiftCube class.">_liftCube</a>; 
<a name="l00043"></a><a class="code" href="class_state_machine.html#a5d310dbe85beb16a46b672c1dcd46697">00043</a>   <a class="code" href="class_extended_move.html" title="Allows to define extended car control instuctions.">ExtendedMove</a>* <a class="code" href="class_state_machine.html#a5d310dbe85beb16a46b672c1dcd46697" title="The reference to the ExtendedMove class.">_extMove</a>; 
<a name="l00044"></a>00044 
<a name="l00045"></a><a class="code" href="class_state_machine.html#a51a47153c3502bb1d8c57c4b0343b5c5">00045</a>   <a class="code" href="class_line_follow.html">LineFollow</a> <a class="code" href="class_state_machine.html#a51a47153c3502bb1d8c57c4b0343b5c5">lineFollow</a>;
<a name="l00046"></a><a class="code" href="class_state_machine.html#abde46fcc0c72e89a79a406658ff15a02">00046</a>   <a class="code" href="class_curve_left.html" title="The CurveLeft class will control the car during the 90° left curve.">CurveLeft</a> <a class="code" href="class_state_machine.html#abde46fcc0c72e89a79a406658ff15a02">curveLeft</a>;
<a name="l00047"></a><a class="code" href="class_state_machine.html#a3c6370e9fff729723a0ccc5f08640912">00047</a>   <a class="code" href="class_cube_approach.html">CubeApproach</a> <a class="code" href="class_state_machine.html#a3c6370e9fff729723a0ccc5f08640912">_cubeApproach</a>;
<a name="l00048"></a><a class="code" href="class_state_machine.html#a0b84a9d673ee44b695a28d7b3b625570">00048</a>   <a class="code" href="class_move_back_to_line.html" title="The MoveBackToLine class will navigate car back to the line according to the stored information from ...">MoveBackToLine</a> <a class="code" href="class_state_machine.html#a0b84a9d673ee44b695a28d7b3b625570">_moveBackToLine</a>;
<a name="l00049"></a>00049 
<a name="l00059"></a><a class="code" href="class_state_machine.html#aa1b860ad26d28c1e681c119e67a6a03b">00059</a>   <span class="keywordtype">boolean</span> <a class="code" href="class_state_machine.html#aa1b860ad26d28c1e681c119e67a6a03b" title="Will be set to true if the stateMachine shall switch to the next state immediately.">forceChangeState</a>;
<a name="l00060"></a>00060   
<a name="l00065"></a><a class="code" href="class_state_machine.html#ae77ef910dec803d51efe9f92f145744d">00065</a>   <span class="keywordtype">boolean</span> <a class="code" href="class_state_machine.html#ae77ef910dec803d51efe9f92f145744d">extMoveCommandDriveOverFinishLineStarted</a>;
<a name="l00066"></a>00066 
<a name="l00067"></a>00067   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a26dd1980d9d8f24050b624fb16ac0e58">checkCommands</a>();
<a name="l00068"></a>00068   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a6f5d5d6b56b9b204725798ed786f6dcd">changeState</a>(<a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">TParcoursState</a> newState);
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#ab3634a64f8a4065a7586fcd7b32883d1">startDriveOverFinishLineExtMoveCommand</a>();
<a name="l00070"></a>00070 <span class="keyword">public</span>:
<a name="l00071"></a>00071   <span class="keyword">static</span> <a class="code" href="class_state_machine.html">StateMachine</a>* <a class="code" href="class_state_machine.html#a7f7482a9af6910035a62f9c116165f60">getInstance</a>();
<a name="l00072"></a><a class="code" href="class_state_machine.html#ad5bffb8688259c021049ffd46803a3a1">00072</a>   <a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">TParcoursState</a> <a class="code" href="class_state_machine.html#ad5bffb8688259c021049ffd46803a3a1">parcoursState</a>;
<a name="l00073"></a><a class="code" href="class_state_machine.html#aba41f59808f08876f67aefcb436ff00a">00073</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_state_machine.html#aba41f59808f08876f67aefcb436ff00a" title="Holds the timestamp when the parcours starts.">startParcoursTimestamp</a>; 
<a name="l00074"></a>00074   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a32064aba8c9fa4afcb649d01aaf5fd78">doJob</a>();
<a name="l00075"></a>00075   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a2e269f59e372184da681ec60d9d3a02e">startParcours</a>();
<a name="l00076"></a>00076   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a2581b0509842f049b330fa2c358aaa77">startParcoursAtState</a>(<a class="code" href="_state_machine_8h.html#ad5f3c64cf1a6afd0af12270f4a539ce8">TParcoursState</a> state);
<a name="l00077"></a>00077   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#a7d0130525bd2e5314fd0b17e568c307a">stopParcours</a>();
<a name="l00078"></a>00078   <span class="keywordtype">void</span> <a class="code" href="class_state_machine.html#afef8b4998682dc7448db148a4a3de74e">changeActivateMessageFilter</a>(<span class="keywordtype">boolean</span> newState);
<a name="l00079"></a>00079   <span class="keywordtype">int</span> <a class="code" href="class_state_machine.html#af2e08cda15a6791502d2743e1f530357">getCurrentBatteryVoltageLevel</a>();
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081 <span class="preprocessor">#endif</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_state_machine_8h.html">StateMachine.h</a>      </li>

    <li class="footer">Generated on Thu Jun 7 2012 20:47:43 for prencar by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
